home *** CD-ROM | disk | FTP | other *** search
- From jdc@naucse.cse.nau.edu Thu Mar 5 09:27:17 1992
- Return-Path: <jdc@naucse.cse.nau.edu>
- Received: from naucse.cse.nau.edu by ra-next.arc.nasa.gov (NeXT-1.0 (From Sendmail 5.52)/NeXT-1.0)
- id AA10638; Thu, 5 Mar 92 09:27:04 PST
- Received: by naucse.cse.nau.edu (5.65c/1.5-nau)
- id AA21546; Thu, 5 Mar 1992 10:32:46 -0700
- Message-Id: <199203051732.AA21546@naucse.cse.nau.edu>
- From: jdc@naucse.cse.nau.edu (John Campbell)
- Date: Thu, 5 Mar 1992 10:32:44 MST
- X-Mailer: Mail User's Shell (7.2.3 5/22/91)
- To: woo@ra-next.arc.nasa.gov
- Subject: gplotlib.shr5
- Status: R
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 5 (of 5)."
- # Contents: gterm.c
- # Wrapped by jdc@naucse.cse.nau.edu on Tue Feb 11 08:42:18 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'gterm.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gterm.c'\"
- else
- echo shar: Extracting \"'gterm.c'\" \(53371 characters\)
- sed "s/^X//" >'gterm.c' <<'END_OF_FILE'
- X/* GNUPLOT - term.c */
- X/*
- X * Copyright (C) 1986, 1987, 1990, 1991 Thomas Williams, Colin Kelley
- X *
- X * Permission to use, copy, and distribute this software and its
- X * documentation for any purpose with or without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and
- X * that both that copyright notice and this permission notice appear
- X * in supporting documentation.
- X *
- X * Permission to modify the software is granted, but not the right to
- X * distribute the modified code. Modifications are to be distributed
- X * as patches to released version.
- X *
- X * This software is provided "as is" without express or implied warranty.
- X *
- X *
- X * AUTHORS
- X *
- X * Original Software:
- X * Thomas Williams, Colin Kelley.
- X *
- X * Gnuplot 2.0 additions:
- X * Russell Lang, Dave Kotz, John Campbell.
- X *
- X * Gnuplot 3.0 additions:
- X * Gershon Elber and many others.
- X *
- X * Send your comments or suggestions to
- X * pixar!info-gnuplot@sun.com.
- X * This is a mailing list; to join it send a note to
- X * pixar!info-gnuplot-request@sun.com.
- X * Send bug reports to
- X * pixar!bug-gnuplot@sun.com.
- X */
- X
- X
- X/*-
- X gnuplot Graphics Terminal library: gterm.c
- X
- X This module provides access to the gnuplot terminal device drivers
- X as callable routines for 'C' programmers.
- X-*/
- X
- X#include <stdio.h>
- X#define GT_OWNER
- X#include "gtplot.h"
- X#include "setshow.h"
- X#include "term.h"
- X#include "bitmap.h"
- X
- X/* Definitions needed to make gterm.c standalone and usable. */
- X#define outfile GToutfile /* Epson and LaTeX drivers. */
- X#define term GTterm
- X#define term_tbl GTterm_tbl /* eepic, latex, and sun drivers. */
- X#define xsize GTxsize
- X#define ysize GTysize /* Postscript and latex drivers. */
- X/*
- X Only the Epson driver requires this gnuplot alloc (from misc.c)
- X Maybe a patch can go out to just have it do a malloc for the
- X bitmap? jdc
- X*/
- X
- X/* alloc:
- X * allocate memory
- X * This is a protected version of malloc used throughout gnuplot proper.
- X */
- X
- Xchar *
- Xalloc(size, message)
- X unsigned int size; /* # of bytes */
- X char *message; /* description of what is being allocated */
- X{
- X char *p; /* the new allocation */
- X extern char *malloc();
- X
- X p = malloc(size);
- X if (p == (char *)NULL) {
- X if (message != NULL) {
- X (void) fprintf(stderr, "out of memory for %s", message);
- X exit(1);
- X /* NOTREACHED */
- X }
- X /* else we return NULL */
- X }
- X return(p);
- X}
- X
- X/* Also a fake int_error for the gterm world. */
- Xint_error(str,flag)
- Xchar *str;
- Xint flag;
- X{
- X fprintf (stderr, str);
- X exit(1);
- X}
- X
- X/* for use by all drivers */
- X#define sign(x) ((x) >= 0 ? 1 : -1)
- X#define abs(x) ((x) >= 0 ? (x) : -(x))
- X#define max(a,b) ((a) > (b) ? (a) : (b))
- X#define min(a,b) ((a) < (b) ? (a) : (b))
- X
- XBOOLEAN term_init = 0; /* true if terminal has been initialized */
- X
- Xextern FILE *outfile;
- Xextern char outstr[];
- Xextern BOOLEAN term_init;
- Xextern int term;
- Xextern float xsize, ysize;
- X
- X/* These need to be "owned" by someone--may as well be gterm.c. */
- Xchar input_line[MAX_LINE_LEN];
- Xchar term_options[80]='\0';
- Xstruct lexical_unit token[MAX_TOKENS];
- Xint num_tokens = 0, c_token = 0;
- Xextern struct value *const_express();
- X
- XBOOLEAN interactive = 0;
- X
- X/*
- X * instead of <strings.h>
- X */
- Xextern char *strcpy();
- Xextern int strlen(), strcmp(), strncmp();
- X#ifndef AMIGA_AC_5
- Xextern double sqrt();
- X#endif
- X
- Xchar *getenv();
- X
- X#ifdef __TURBOC__
- Xchar *turboc_init();
- X#endif
- X#ifdef PC
- Xvoid reopen_binary();
- X#endif
- X#ifdef vms
- Xchar *vms_init();
- Xvoid vms_reset();
- Xvoid term_mode_tek();
- Xvoid term_mode_native();
- Xvoid term_pasthru();
- Xvoid term_nopasthru();
- Xvoid reopen_binary();
- Xvoid fflush_binary();
- X#endif
- X
- X/* This is needed because the unixplot library only writes to stdout. */
- X#ifdef UNIXPLOT
- XFILE save_stdout;
- X#endif
- Xint unixplot=0;
- X
- X#define NICE_LINE 0
- X#define POINT_TYPES 6
- X
- X
- Xstatic do_point(x,y,number)
- Xint x,y;
- Xint number;
- X{
- Xregister int htic,vtic;
- Xregister struct termentry *t = &term_tbl[term];
- X
- X if (number < 0) { /* do dot */
- X (*t->move)(x,y);
- X (*t->vector)(x,y);
- X return;
- X }
- X
- X number %= POINT_TYPES;
- X htic = (t->h_tic/2); /* should be in term_tbl[] in later version */
- X vtic = (t->v_tic/2);
- X
- X switch(number) {
- X case 0: /* do diamond */
- X (*t->move)(x-htic,y);
- X (*t->vector)(x,y-vtic);
- X (*t->vector)(x+htic,y);
- X (*t->vector)(x,y+vtic);
- X (*t->vector)(x-htic,y);
- X (*t->move)(x,y);
- X (*t->vector)(x,y);
- X break;
- X case 1: /* do plus */
- X (*t->move)(x-htic,y);
- X (*t->vector)(x-htic,y);
- X (*t->vector)(x+htic,y);
- X (*t->move)(x,y-vtic);
- X (*t->vector)(x,y-vtic);
- X (*t->vector)(x,y+vtic);
- X break;
- X case 2: /* do box */
- X (*t->move)(x-htic,y-vtic);
- X (*t->vector)(x-htic,y-vtic);
- X (*t->vector)(x+htic,y-vtic);
- X (*t->vector)(x+htic,y+vtic);
- X (*t->vector)(x-htic,y+vtic);
- X (*t->vector)(x-htic,y-vtic);
- X (*t->move)(x,y);
- X (*t->vector)(x,y);
- X break;
- X case 3: /* do X */
- X (*t->move)(x-htic,y-vtic);
- X (*t->vector)(x-htic,y-vtic);
- X (*t->vector)(x+htic,y+vtic);
- X (*t->move)(x-htic,y+vtic);
- X (*t->vector)(x-htic,y+vtic);
- X (*t->vector)(x+htic,y-vtic);
- X break;
- X case 4: /* do triangle */
- X (*t->move)(x,y+(4*vtic/3));
- X (*t->vector)(x-(4*htic/3),y-(2*vtic/3));
- X (*t->vector)(x+(4*htic/3),y-(2*vtic/3));
- X (*t->vector)(x,y+(4*vtic/3));
- X (*t->move)(x,y);
- X (*t->vector)(x,y);
- X break;
- X case 5: /* do star */
- X (*t->move)(x-htic,y);
- X (*t->vector)(x-htic,y);
- X (*t->vector)(x+htic,y);
- X (*t->move)(x,y-vtic);
- X (*t->vector)(x,y-vtic);
- X (*t->vector)(x,y+vtic);
- X (*t->move)(x-htic,y-vtic);
- X (*t->vector)(x-htic,y-vtic);
- X (*t->vector)(x+htic,y+vtic);
- X (*t->move)(x-htic,y+vtic);
- X (*t->vector)(x-htic,y+vtic);
- X (*t->vector)(x+htic,y-vtic);
- X break;
- X }
- X}
- X
- X
- X/*
- X * general point routine
- X */
- Xstatic line_and_point(x,y,number)
- Xint x,y,number;
- X{
- X /* temporary(?) kludge to allow terminals with bad linetypes
- X to make nice marks */
- X
- X (*term_tbl[term].linetype)(NICE_LINE);
- X do_point(x,y,number);
- X}
- X
- X/*
- X * general arrow routine
- X */
- X#define ROOT2 (1.41421) /* sqrt of 2 */
- X
- Xstatic do_arrow(sx, sy, ex, ey, head)
- X int sx,sy; /* start point */
- X int ex, ey; /* end point (point of arrowhead) */
- X BOOLEAN head;
- X{
- X register struct termentry *t = &term_tbl[term];
- X int len = (t->h_tic + t->v_tic)/2; /* arrowhead size = avg of tic sizes */
- X
- X /* draw the line for the arrow. That's easy. */
- X (*t->move)(sx, sy);
- X (*t->vector)(ex, ey);
- X
- X if (head) {
- X /* now draw the arrow head. */
- X /* we put the arrowhead marks at 45 degrees to line */
- X if (sx == ex) {
- X /* vertical line, special case */
- X int delta = ((float)len / ROOT2 + 0.5);
- X if (sy < ey)
- X delta = -delta; /* up arrow goes the other way */
- X (*t->move)(ex - delta, ey + delta);
- X (*t->vector)(ex,ey);
- X (*t->vector)(ex + delta, ey + delta);
- X } else {
- X int dx = sx - ex;
- X int dy = sy - ey;
- X double coeff = len / sqrt(2.0*((double)dx*(double)dx
- X + (double)dy*(double)dy));
- X int x,y; /* one endpoint */
- X
- X x = (int)( ex + (dx + dy) * coeff );
- X y = (int)( ey + (dy - dx) * coeff );
- X (*t->move)(x,y);
- X (*t->vector)(ex,ey);
- X
- X x = (int)( ex + (dx - dy) * coeff );
- X y = (int)( ey + (dy + dx) * coeff );
- X (*t->vector)(x,y);
- X }
- X }
- X}
- X
- X#ifdef DUMB /* paper or glass dumb terminal */
- X#include "term/dumb.trm"
- X#endif
- X
- X
- X#ifdef PC /* all PC types */
- X#include "term/pc.trm"
- X#endif
- X
- X/*
- X all TEK types (TEK,BITGRAPH,KERMIT,VTTEK,SELANAR) are ifdef'd in tek.trm,
- X but most require various TEK routines. Hence TEK must be defined for
- X the others to compile.
- X*/
- X#ifdef BITGRAPH
- X# ifndef TEK
- X# define TEK
- X# endif
- X#endif
- X
- X#ifdef SELENAR
- X# ifndef TEK
- X# define TEK
- X# endif
- X#endif
- X
- X#ifdef KERMIT
- X# ifndef TEK
- X# define TEK
- X# endif
- X#endif
- X
- X#ifdef LN03P
- X# ifndef TEK
- X# define TEK
- X# endif
- X#endif
- X
- X#ifdef VTTEK
- X# ifndef TEK
- X# define TEK
- X# endif
- X#endif
- X
- X#ifdef T410X /* Tektronix 4106, 4107, 4109 and 420x terminals */
- X#include "term/t410x.trm"
- X#endif
- X
- X#ifdef TEK /* all TEK types, TEK, BBN, SELANAR, KERMIT, VTTEK */
- X#include "term/tek.trm"
- X#endif
- X
- X#ifdef EPSONP /* bit map types, EPSON, NEC, PROPRINTER, STAR Color */
- X#include "term/epson.trm"
- X#endif
- X
- X#ifdef HPLJII /* HP LaserJet II */
- X#include "term/hpljii.trm"
- X#endif
- X
- X#ifdef HPLJII /* HP LaserJet III in HPGL mode */
- X# ifndef HPGL
- X# define HPGL
- X# endif
- X#endif
- X
- X#ifdef FIG /* Fig 1.4FS Interactive graphics program */
- X#include "term/fig.trm"
- X#include "term/bigfig.trm"
- X#endif
- X
- X#ifdef GPR /* Apollo Graphics Primitive Resource (fixed-size window) */
- X#include "term/gpr.trm"
- X#endif /* GPR */
- X
- X#ifdef APOLLO /* Apollo Graphics Primitive Resource (resizable window) */
- X#include "term/apollo.trm"
- X#endif /* APOLLO */
- X
- X#ifdef IMAGEN /* IMAGEN printer */
- X#include "term/imagen.trm"
- X#endif
- X
- X#ifdef EEPIC /* EEPIC (LATEX) type */
- X#include "term/eepic.trm"
- X# ifndef LATEX
- X# define LATEX
- X# endif
- X#endif
- X
- X#ifdef EMTEX /* EMTEX (LATEX for PC) type */
- X# ifndef LATEX
- X# define LATEX
- X# endif
- X#endif
- X
- X#ifdef LATEX /* LATEX type */
- X#include "term/latex.trm"
- X#endif
- X
- X#ifdef POSTSCRIPT /* POSTSCRIPT type */
- X#include "term/post.trm"
- X#endif
- X
- X#ifdef PRESCRIBE /* PRESCRIBE type */
- X#include "term/kyo.trm"
- X#endif
- X
- X#ifdef UNIXPC /* unix-PC ATT 7300 or 3b1 machine */
- X#include "term/unixpc.trm"
- X#endif /* UNIXPC */
- X
- X#ifdef AED
- X#include "term/aed.trm"
- X#endif /* AED */
- X
- X#ifdef CGI
- X#include "term/cgi.trm"
- X#endif /* CGI */
- X
- X#ifdef HP2648
- X/* also works for HP2647 */
- X#include "term/hp2648.trm"
- X#endif /* HP2648 */
- X
- X#ifdef HP26
- X#include "term/hp26.trm"
- X#endif /* HP26 */
- X
- X#ifdef HP75
- X#ifndef HPGL
- X#define HPGL
- X#endif
- X#endif
- X
- X/* HPGL - includes HP75 and HPLJIII in HPGL mode */
- X#ifdef HPGL
- X#include "term/hpgl.trm"
- X#endif /* HPGL */
- X
- X/* Roland DXY800A plotter driver by Martin Yii, eln557h@monu3.OZ
- X and Russell Lang, rjl@monu1.cc.monash.oz */
- X#ifdef DXY800A
- X#include "term/dxy.trm"
- X#endif /* DXY800A */
- X
- X#ifdef IRIS4D
- X#include "term/iris4d.trm"
- X#endif /* IRIS4D */
- X
- X#ifdef QMS
- X#include "term/qms.trm"
- X#endif /* QMS */
- X
- X#ifdef REGIS
- X#include "term/regis.trm"
- X#endif /* REGIS */
- X
- X#ifdef SUN
- X#include "term/sun.trm"
- X#endif /* SUN */
- X
- X#ifdef VWS
- X#include "term/vws.trm"
- X#endif /* VWS */
- X
- X#ifdef V384
- X#include "term/v384.trm"
- X#endif /* V384 */
- X
- X#ifdef UNIXPLOT
- X#include "term/unixplot.trm"
- X#endif /* UNIXPLOT */
- X
- X#ifdef X11
- X#include "term/x11.trm"
- X#endif /* X11 */
- X
- X#ifdef DXF
- X#include "term/dxf.trm"
- X#endif /* DXF */
- X
- X#ifdef AMIGASCREEN
- X#include "term/amiga.trm"
- X#endif
- X
- X
- X/* Dummy functions for unavailable features */
- X
- X/* change angle of text. 0 is horizontal left to right.
- X* 1 is vertical bottom to top (90 deg rotate)
- X*/
- Xstatic int null_text_angle()
- X{
- Xreturn FALSE ; /* can't be done */
- X}
- X
- X/* change justification of text.
- X * modes are LEFT (flush left), CENTRE (centred), RIGHT (flush right)
- X */
- Xstatic int null_justify_text()
- X{
- Xreturn FALSE ; /* can't be done */
- X}
- X
- X
- X/* Change scale of plot.
- X * Parameters are x,y scaling factors for this plot.
- X * Some terminals (eg latex) need to do scaling themselves.
- X */
- Xstatic int null_scale()
- X{
- Xreturn FALSE ; /* can't be done */
- X}
- X
- Xstatic int do_scale()
- X{
- Xreturn TRUE ; /* can be done */
- X}
- X
- Xstatic options_null()
- X{
- X term_options[0] = '\0'; /* we have no options */
- X}
- X
- Xstatic UNKNOWN_null()
- X{
- X}
- X
- X/*
- X * term_tbl[] contains an entry for each terminal. "unknown" must be the
- X * first, since term is initialized to 0.
- X */
- Xstruct termentry term_tbl[] = {
- X {"unknown", "Unknown terminal type - not a plotting device",
- X 100, 100, 1, 1,
- X 1, 1, options_null, UNKNOWN_null, UNKNOWN_null,
- X UNKNOWN_null, null_scale, UNKNOWN_null, UNKNOWN_null, UNKNOWN_null,
- X UNKNOWN_null, UNKNOWN_null, null_text_angle,
- X null_justify_text, UNKNOWN_null, UNKNOWN_null}
- X
- X#ifdef AMIGASCREEN
- X ,{"amiga", "Amiga Custom Screen",
- X AMIGA_XMAX, AMIGA_YMAX, AMIGA_VCHAR, AMIGA_HCHAR,
- X AMIGA_VTIC, AMIGA_HTIC, options_null, AMIGA_init, AMIGA_reset,
- X AMIGA_text, null_scale, AMIGA_graphics, AMIGA_move, AMIGA_vector,
- X AMIGA_linetype, AMIGA_put_text, null_text_angle,
- X AMIGA_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef DUMB
- X ,{"dumb", "printer or glass dumb terminal",
- X DUMB_XMAX, DUMB_YMAX, 1, 1,
- X 1, 1, DUMB_options, DUMB_init, DUMB_reset,
- X DUMB_text, null_scale, DUMB_graphics, DUMB_move, DUMB_vector,
- X DUMB_linetype, DUMB_put_text, null_text_angle,
- X null_justify_text, DUMB_point, DUMB_arrow}
- X#endif
- X
- X#ifdef PC
- X#ifdef __TURBOC__
- X
- X ,{"egalib", "IBM PC/Clone with EGA graphics board",
- X EGALIB_XMAX, EGALIB_YMAX, EGALIB_VCHAR, EGALIB_HCHAR,
- X EGALIB_VTIC, EGALIB_HTIC, options_null, EGALIB_init, EGALIB_reset,
- X EGALIB_text, null_scale, EGALIB_graphics, EGALIB_move, EGALIB_vector,
- X EGALIB_linetype, EGALIB_put_text, EGALIB_text_angle,
- X EGALIB_justify_text, do_point, do_arrow}
- X
- X ,{"vgalib", "IBM PC/Clone with VGA graphics board",
- X VGA_XMAX, VGA_YMAX, VGA_VCHAR, VGA_HCHAR,
- X VGA_VTIC, VGA_HTIC, options_null, VGA_init, VGA_reset,
- X VGA_text, null_scale, VGA_graphics, VGA_move, VGA_vector,
- X VGA_linetype, VGA_put_text, VGA_text_angle,
- X VGA_justify_text, do_point, do_arrow}
- X
- X ,{"vgamono", "IBM PC/Clone with VGA Monochrome graphics board",
- X VGA_XMAX, VGA_YMAX, VGA_VCHAR, VGA_HCHAR,
- X VGA_VTIC, VGA_HTIC, options_null, VGA_init, VGA_reset,
- X VGA_text, null_scale, VGA_graphics, VGA_move, VGA_vector,
- X VGAMONO_linetype, VGA_put_text, VGA_text_angle,
- X VGA_justify_text, line_and_point, do_arrow}
- X
- X ,{"svga", "IBM PC/Clone with Super VGA graphics board",
- X SVGA_XMAX, SVGA_YMAX, SVGA_VCHAR, SVGA_HCHAR,
- X SVGA_VTIC, SVGA_HTIC, options_null, SVGA_init, SVGA_reset,
- X SVGA_text, null_scale, SVGA_graphics, SVGA_move, SVGA_vector,
- X SVGA_linetype, SVGA_put_text, SVGA_text_angle,
- X SVGA_justify_text, do_point, do_arrow}
- X
- X ,{"mcga", "IBM PC/Clone with MCGA graphics board",
- X MCGA_XMAX, MCGA_YMAX, MCGA_VCHAR, MCGA_HCHAR,
- X MCGA_VTIC, MCGA_HTIC, options_null, MCGA_init, MCGA_reset,
- X MCGA_text, null_scale, MCGA_graphics, MCGA_move, MCGA_vector,
- X MCGA_linetype, MCGA_put_text, MCGA_text_angle,
- X MCGA_justify_text, line_and_point, do_arrow}
- X
- X ,{"cga", "IBM PC/Clone with CGA graphics board",
- X CGA_XMAX, CGA_YMAX, CGA_VCHAR, CGA_HCHAR,
- X CGA_VTIC, CGA_HTIC, options_null, CGA_init, CGA_reset,
- X CGA_text, null_scale, CGA_graphics, CGA_move, CGA_vector,
- X CGA_linetype, CGA_put_text, MCGA_text_angle,
- X CGA_justify_text, line_and_point, do_arrow}
- X
- X ,{"hercules", "IBM PC/Clone with Hercules graphics board",
- X HERC_XMAX, HERC_YMAX, HERC_VCHAR, HERC_HCHAR,
- X HERC_VTIC, HERC_HTIC, options_null, HERC_init, HERC_reset,
- X HERC_text, null_scale, HERC_graphics, HERC_move, HERC_vector,
- X HERC_linetype, HERC_put_text, MCGA_text_angle,
- X HERC_justify_text, line_and_point, do_arrow}
- X#ifdef ATT6300
- X ,{"att", "IBM PC/Clone with AT&T 6300 graphics board",
- X ATT_XMAX, ATT_YMAX, ATT_VCHAR, ATT_HCHAR,
- X ATT_VTIC, ATT_HTIC, options_null, ATT_init, ATT_reset,
- X ATT_text, null_scale, ATT_graphics, ATT_move, ATT_vector,
- X ATT_linetype, ATT_put_text, ATT_text_angle,
- X ATT_justify_text, line_and_point, do_arrow}
- X#endif
- X#else /* TURBO */
- X
- X ,{"cga", "IBM PC/Clone with CGA graphics board",
- X CGA_XMAX, CGA_YMAX, CGA_VCHAR, CGA_HCHAR,
- X CGA_VTIC, CGA_HTIC, options_null, CGA_init, CGA_reset,
- X CGA_text, null_scale, CGA_graphics, CGA_move, CGA_vector,
- X CGA_linetype, CGA_put_text, CGA_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X
- X ,{"egabios", "IBM PC/Clone with EGA graphics board (BIOS)",
- X EGA_XMAX, EGA_YMAX, EGA_VCHAR, EGA_HCHAR,
- X EGA_VTIC, EGA_HTIC, options_null, EGA_init, EGA_reset,
- X EGA_text, null_scale, EGA_graphics, EGA_move, EGA_vector,
- X EGA_linetype, EGA_put_text, EGA_text_angle,
- X null_justify_text, do_point, do_arrow}
- X
- X ,{"vgabios", "IBM PC/Clone with VGA graphics board (BIOS)",
- X VGA_XMAX, VGA_YMAX, VGA_VCHAR, VGA_HCHAR,
- X VGA_VTIC, VGA_HTIC, options_null, VGA_init, VGA_reset,
- X VGA_text, null_scale, VGA_graphics, VGA_move, VGA_vector,
- X VGA_linetype, VGA_put_text, VGA_text_angle,
- X null_justify_text, do_point, do_arrow}
- X
- X#ifdef EGALIB
- X ,{"egalib", "IBM PC/Clone with EGA graphics board (LIB)",
- X EGALIB_XMAX, EGALIB_YMAX, EGALIB_VCHAR, EGALIB_HCHAR,
- X EGALIB_VTIC, EGALIB_HTIC, options_null, EGALIB_init, EGALIB_reset,
- X EGALIB_text, null_scale, EGALIB_graphics, EGALIB_move, EGALIB_vector,
- X EGALIB_linetype, EGALIB_put_text, null_text_angle,
- X null_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef HERCULES
- X ,{"hercules", "IBM PC/Clone with Hercules graphics board",
- X HERC_XMAX, HERC_YMAX, HERC_VCHAR, HERC_HCHAR,
- X HERC_VTIC, HERC_HTIC, options_null, HERC_init, HERC_reset,
- X HERC_text, null_scale, HERC_graphics, HERC_move, HERC_vector,
- X HERC_linetype, HERC_put_text, HERC_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif /* HERCULES */
- X
- X#ifdef ATT6300
- X ,{"att", "AT&T PC/6300 graphics",
- X ATT_XMAX, ATT_YMAX, ATT_VCHAR, ATT_HCHAR,
- X ATT_VTIC, ATT_HTIC, options_null, ATT_init, ATT_reset,
- X ATT_text, null_scale, ATT_graphics, ATT_move, ATT_vector,
- X ATT_linetype, ATT_put_text, ATT_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef CORONA
- X ,{"corona325", "Corona graphics ???",
- X COR_XMAX, COR_YMAX, COR_VCHAR, COR_HCHAR,
- X COR_VTIC, COR_HTIC, options_null, COR_init, COR_reset,
- X COR_text, null_scale, COR_graphics, COR_move, COR_vector,
- X COR_linetype, COR_put_text, COR_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif /* CORONA */
- X#endif /* TURBO */
- X#endif /* PC */
- X
- X#ifdef AED
- X ,{"aed512", "AED 512 Terminal",
- X AED5_XMAX, AED_YMAX, AED_VCHAR, AED_HCHAR,
- X AED_VTIC, AED_HTIC, options_null, AED_init, AED_reset,
- X AED_text, null_scale, AED_graphics, AED_move, AED_vector,
- X AED_linetype, AED_put_text, null_text_angle,
- X null_justify_text, do_point, do_arrow}
- X ,{"aed767", "AED 767 Terminal",
- X AED_XMAX, AED_YMAX, AED_VCHAR, AED_HCHAR,
- X AED_VTIC, AED_HTIC, options_null, AED_init, AED_reset,
- X AED_text, null_scale, AED_graphics, AED_move, AED_vector,
- X AED_linetype, AED_put_text, null_text_angle,
- X null_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef APOLLO
- X ,{"apollo", "Apollo Graphics Primitive Resource, rescaling of subsequent plots after window resizing",
- X 0, 0, 0, 0, /* APOLLO_XMAX, APOLLO_YMAX, APOLLO_VCHAR, APOLLO_HCHAR, are filled in at run-time */
- X APOLLO_VTIC, APOLLO_HTIC, options_null, APOLLO_init, APOLLO_reset,
- X APOLLO_text, null_scale, APOLLO_graphics, APOLLO_move, APOLLO_vector,
- X APOLLO_linetype, APOLLO_put_text, APOLLO_text_angle,
- X APOLLO_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef GPR
- X ,{"gpr", "Apollo Graphics Primitive Resource, fixed-size window",
- X GPR_XMAX, GPR_YMAX, GPR_VCHAR, GPR_HCHAR,
- X GPR_VTIC, GPR_HTIC, options_null, GPR_init, GPR_reset,
- X GPR_text, null_scale, GPR_graphics, GPR_move, GPR_vector,
- X GPR_linetype, GPR_put_text, GPR_text_angle,
- X GPR_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef BITGRAPH
- X ,{"bitgraph", "BBN Bitgraph Terminal",
- X BG_XMAX,BG_YMAX,BG_VCHAR, BG_HCHAR,
- X BG_VTIC, BG_HTIC, options_null, BG_init, BG_reset,
- X BG_text, null_scale, BG_graphics, BG_move, BG_vector,
- X BG_linetype, BG_put_text, null_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef CGI
- X ,{"cgi", "SCO CGI drivers (requires CGIDISP or CGIPRNT env variable)",
- X CGI_XMAX, CGI_YMAX, 0, 0,
- X CGI_VTIC, 0, options_null, CGI_init, CGI_reset,
- X CGI_text, null_scale, CGI_graphics, CGI_move, CGI_vector,
- X CGI_linetype, CGI_put_text, CGI_text_angle,
- X CGI_justify_text, CGI_point, do_arrow}
- X
- X ,{"hcgi", "SCO CGI drivers (hardcopy, requires CGIPRNT env variable)",
- X CGI_XMAX, CGI_YMAX, 0, 0,
- X CGI_VTIC, 0, options_null, HCGI_init, CGI_reset,
- X CGI_text, null_scale, CGI_graphics, CGI_move, CGI_vector,
- X CGI_linetype, CGI_put_text, CGI_text_angle,
- X CGI_justify_text, CGI_point, do_arrow}
- X#endif
- X
- X#ifdef DXF
- X ,{"dxf", "dxf-file for AutoCad (default size 120x80)",
- X DXF_XMAX,DXF_YMAX,DXF_VCHAR, DXF_HCHAR,
- X DXF_VTIC, DXF_HTIC, options_null,DXF_init, DXF_reset,
- X DXF_text, null_scale, DXF_graphics, DXF_move, DXF_vector,
- X DXF_linetype, DXF_put_text, DXF_text_angle,
- X DXF_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef DXY800A
- X ,{"dxy800a", "Roland DXY800A plotter",
- X DXY_XMAX, DXY_YMAX, DXY_VCHAR, DXY_HCHAR,
- X DXY_VTIC, DXY_HTIC, options_null, DXY_init, DXY_reset,
- X DXY_text, null_scale, DXY_graphics, DXY_move, DXY_vector,
- X DXY_linetype, DXY_put_text, DXY_text_angle,
- X null_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef EEPIC
- X ,{"eepic", "EEPIC -- extended LaTeX picture environment",
- X EEPIC_XMAX, EEPIC_YMAX, EEPIC_VCHAR, EEPIC_HCHAR,
- X EEPIC_VTIC, EEPIC_HTIC, options_null, EEPIC_init, EEPIC_reset,
- X EEPIC_text, EEPIC_scale, EEPIC_graphics, EEPIC_move, EEPIC_vector,
- X EEPIC_linetype, EEPIC_put_text, EEPIC_text_angle,
- X EEPIC_justify_text, EEPIC_point, EEPIC_arrow}
- X#endif
- X
- X#ifdef EMTEX
- X
- X ,{"emtex", "LATEX picture environment with emTeX specials",
- X LATEX_XMAX, LATEX_YMAX, LATEX_VCHAR, LATEX_HCHAR,
- X LATEX_VTIC, LATEX_HTIC, options_null, EMTEX_init, EMTEX_reset,
- X EMTEX_text, LATEX_scale, LATEX_graphics, LATEX_move, LATEX_vector,
- X LATEX_linetype, LATEX_put_text, LATEX_text_angle,
- X LATEX_justify_text, LATEX_point, LATEX_arrow}
- X#endif
- X
- X#ifdef EPS60
- X ,{"epson_60dpi", "Epson-style 60-dot per inch printers",
- X EPS60XMAX, EPS60YMAX, EPSONVCHAR, EPSONHCHAR,
- X EPSONVTIC, EPSONHTIC, options_null, EPSONinit, EPSONreset,
- X EPS60text, null_scale, EPS60graphics, EPSONmove, EPSONvector,
- X EPSONlinetype, EPSONput_text, EPSON_text_angle,
- X null_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef EPSONP
- X ,{"epson_lx800", "Epson LX-800, Star NL-10, NX-1000, PROPRINTER ...",
- X EPSONXMAX, EPSONYMAX, EPSONVCHAR, EPSONHCHAR,
- X EPSONVTIC, EPSONHTIC, options_null, EPSONinit, EPSONreset,
- X EPSONtext, null_scale, EPSONgraphics, EPSONmove, EPSONvector,
- X EPSONlinetype, EPSONput_text, EPSON_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef FIG
- X ,{"fig", "FIG graphics language: SunView or X graphics editor",
- X FIG_XMAX, FIG_YMAX, FIG_VCHAR, FIG_HCHAR,
- X FIG_VTIC, FIG_HTIC, options_null, FIG_init, FIG_reset,
- X FIG_text, null_scale, FIG_graphics, FIG_move, FIG_vector,
- X FIG_linetype, FIG_put_text, FIG_text_angle,
- X FIG_justify_text, do_point, FIG_arrow}
- X ,{"bfig", "FIG graphics language: SunView or X graphics editor. Large Graph",
- X BFIG_XMAX, BFIG_YMAX, BFIG_VCHAR, BFIG_HCHAR,
- X BFIG_VTIC, BFIG_HTIC, options_null, FIG_init, FIG_reset,
- X FIG_text, null_scale, FIG_graphics, FIG_move, BFIG_vector,
- X FIG_linetype, BFIG_put_text, FIG_text_angle,
- X FIG_justify_text, do_point, BFIG_arrow}
- X#endif
- X
- X#ifdef HP26
- X ,{"hp2623A", "HP2623A and maybe others",
- X HP26_XMAX, HP26_YMAX, HP26_VCHAR, HP26_HCHAR,
- X HP26_VTIC, HP26_HTIC, options_null, HP26_init, HP26_reset,
- X HP26_text, null_scale, HP26_graphics, HP26_move, HP26_vector,
- X HP26_linetype, HP26_put_text, null_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef HP2648
- X ,{"hp2648", "HP2648 and HP2647",
- X HP2648XMAX, HP2648YMAX, HP2648VCHAR, HP2648HCHAR,
- X HP2648VTIC, HP2648HTIC, options_null, HP2648init, HP2648reset,
- X HP2648text, null_scale, HP2648graphics, HP2648move, HP2648vector,
- X HP2648linetype, HP2648put_text, HP2648_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef HP75
- X ,{"hp7580B", "HP7580, and probably other HPs (4 pens)",
- X HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
- X HPGL_VTIC, HPGL_HTIC, options_null, HPGL_init, HPGL_reset,
- X HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
- X HP75_linetype, HPGL_put_text, HPGL_text_angle,
- X null_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef HPGL
- X ,{"hpgl", "HP7475 and (hopefully) lots of others (6 pens)",
- X HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
- X HPGL_VTIC, HPGL_HTIC, options_null, HPGL_init, HPGL_reset,
- X HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
- X HPGL_linetype, HPGL_put_text, HPGL_text_angle,
- X null_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef HPLJII
- X ,{"hpljii", "HP Laserjet series II, [75 100 150 300]",
- X HPLJII_75PPI_XMAX, HPLJII_75PPI_YMAX, HPLJII_75PPI_VCHAR,
- X HPLJII_75PPI_HCHAR, HPLJII_75PPI_VTIC, HPLJII_75PPI_HTIC, HPLJIIoptions,
- X HPLJIIinit, HPLJIIreset, HPLJIItext, null_scale,
- X HPLJIIgraphics, HPLJIImove, HPLJIIvector, HPLJIIlinetype,
- X HPLJIIput_text, HPLJIItext_angle, null_justify_text, line_and_point,
- X do_arrow}
- X ,{"hpdj", "HP DeskJet 500, [75 100 150 300]",
- X HPLJII_75PPI_XMAX, HPLJII_75PPI_YMAX, HPLJII_75PPI_VCHAR,
- X HPLJII_75PPI_HCHAR, HPLJII_75PPI_VTIC, HPLJII_75PPI_HTIC, HPLJIIoptions,
- X HPLJIIinit, HPLJIIreset, HPDJtext, null_scale,
- X HPDJgraphics, HPLJIImove, HPLJIIvector, HPLJIIlinetype,
- X HPDJput_text, HPDJtext_angle, null_justify_text, line_and_point,
- X do_arrow}
- X#endif
- X
- X#ifdef HPLJIII
- X ,{"hpljiii_port", "HP laserjet iii (using HPGL plot vectors), portrait mode",
- X HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
- X HPGL_VTIC, HPGL_HTIC, options_null, HPLJIII_PORT_init, HPLJIII_reset,
- X HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
- X HPGL_linetype, HPGL_put_text, HPGL_text_angle,
- X null_justify_text, do_point, do_arrow}
- X ,{"hpljiii_land", "HP laserjet iii (using HPGL plot vectors), landscape mode",
- X HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
- X HPGL_VTIC, HPGL_HTIC, options_null, HPLJIII_LAND_init, HPLJIII_reset,
- X HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
- X HPGL_linetype, HPGL_put_text, HPGL_text_angle,
- X null_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef IMAGEN
- X ,{"imagen", "Imagen laser printer",
- X IMAGEN_XMAX, IMAGEN_YMAX, IMAGEN_VCHAR, IMAGEN_HCHAR,
- X IMAGEN_VTIC, IMAGEN_HTIC, options_null, IMAGEN_init, IMAGEN_reset,
- X IMAGEN_text, null_scale, IMAGEN_graphics, IMAGEN_move,
- X IMAGEN_vector, IMAGEN_linetype, IMAGEN_put_text, IMAGEN_text_angle,
- X IMAGEN_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef IRIS4D
- X ,{"iris4d", "Silicon Graphics IRIS 4D Series Computer",
- X IRIS4D_XMAX, IRIS4D_YMAX, IRIS4D_VCHAR, IRIS4D_HCHAR,
- X IRIS4D_VTIC, IRIS4D_HTIC, IRIS4D_options, IRIS4D_init, IRIS4D_reset,
- X IRIS4D_text, null_scale, IRIS4D_graphics, IRIS4D_move, IRIS4D_vector,
- X IRIS4D_linetype, IRIS4D_put_text, null_text_angle,
- X null_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef KERMIT
- X ,{"kc_tek40xx", "Kermit-MS tek40xx terminal emulator - color",
- X TEK40XMAX,TEK40YMAX,TEK40VCHAR, KTEK40HCHAR,
- X TEK40VTIC, TEK40HTIC, options_null, TEK40init, KTEK40reset,
- X KTEK40Ctext, null_scale, KTEK40graphics, TEK40move, TEK40vector,
- X KTEK40Clinetype, TEK40put_text, null_text_angle,
- X null_justify_text, do_point, do_arrow}
- X ,{"km_tek40xx", "Kermit-MS tek40xx terminal emulator - monochrome",
- X TEK40XMAX,TEK40YMAX,TEK40VCHAR, KTEK40HCHAR,
- X TEK40VTIC, TEK40HTIC, options_null, TEK40init, KTEK40reset,
- X TEK40text, null_scale, KTEK40graphics, TEK40move, TEK40vector,
- X KTEK40Mlinetype, TEK40put_text, null_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef LATEX
- X ,{"latex", "LaTeX picture environment",
- X LATEX_XMAX, LATEX_YMAX, LATEX_VCHAR, LATEX_HCHAR,
- X LATEX_VTIC, LATEX_HTIC, options_null, LATEX_init, LATEX_reset,
- X LATEX_text, LATEX_scale, LATEX_graphics, LATEX_move, LATEX_vector,
- X LATEX_linetype, LATEX_put_text, LATEX_text_angle,
- X LATEX_justify_text, LATEX_point, LATEX_arrow}
- X#endif
- X
- X#ifdef LN03P
- X ,{"ln03", "LN03-plus laser printer in tektronix mode",
- X TEK40XMAX, TEK40YMAX, TEK40VCHAR, TEK40HCHAR,
- X TEK40VTIC, TEK40HTIC, options_null, LN03Pinit, LN03Preset,
- X TEK40text, null_scale, TEK40graphics, TEK40move, TEK40vector,
- X TEK40linetype, TEK40put_text, null_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef NEC
- X ,{"nec_cp6m", "NEC printer CP6, Epson LQ-800 Monochrome",
- X NECXMAX, NECYMAX, NECVCHAR, NECHCHAR,
- X NECVTIC, NECHTIC, options_null, NECinit, NECreset,
- X NECtext, null_scale, NECMgraphics, NECmove, NECvector,
- X NECMlinetype, NECput_text, NEC_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X ,{"nec_cp6c", "NEC printer CP6 Color",
- X NECXMAX, NECYMAX, NECVCHAR, NECHCHAR,
- X NECVTIC, NECHTIC, options_null, NECinit, NECreset,
- X NECtext, null_scale, NECCgraphics, NECmove, NECvector,
- X NECClinetype, NECput_text, NEC_text_angle,
- X null_justify_text, do_point, do_arrow}
- X ,{"nec_cp6d", "NEC printer CP6, Epson LQ-800 Draft monochrome",
- X NECXMAX, NECYMAX, NECVCHAR, NECHCHAR,
- X NECVTIC, NECHTIC, options_null, NECinit, NECreset,
- X NECdraft_text, null_scale, NECMgraphics, NECmove, NECvector,
- X NECMlinetype, NECput_text, NEC_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef POSTSCRIPT
- X ,{"postscript", "PostScript graphics language [mode \042fontname\042 font_size]",
- X PS_XMAX, PS_YMAX, PS_VCHAR, PS_HCHAR,
- X PS_VTIC, PS_HTIC, PS_options, PS_init, PS_reset,
- X PS_text, do_scale, PS_graphics, PS_move, PS_vector,
- X PS_linetype, PS_put_text, PS_text_angle,
- X PS_justify_text, PS_point, do_arrow}
- X#endif
- X
- X#ifdef PRESCRIBE
- X ,{"prescribe", "Prescribe - for the Kyocera Laser Printer",
- X PRE_XMAX, PRE_YMAX, PRE_VCHAR, PRE_HCHAR,
- X PRE_VTIC, PRE_HTIC, options_null, PRE_init, PRE_reset,
- X PRE_text, null_scale, PRE_graphics, PRE_move, PRE_vector,
- X PRE_linetype, PRE_put_text, null_text_angle,
- X PRE_justify_text, line_and_point, do_arrow}
- X ,{"kyo", "Kyocera Laser Printer with Courier font",
- X PRE_XMAX, PRE_YMAX, KYO_VCHAR, KYO_HCHAR,
- X PRE_VTIC, PRE_HTIC, options_null, KYO_init, PRE_reset,
- X PRE_text, null_scale, PRE_graphics, PRE_move, PRE_vector,
- X PRE_linetype, PRE_put_text, null_text_angle,
- X PRE_justify_text, line_and_point, do_arrow}
- X#endif /* PRESCRIBE */
- X
- X#ifdef QMS
- X ,{"qms", "QMS/QUIC Laser printer (also Talaris 1200 and others)",
- X QMS_XMAX,QMS_YMAX, QMS_VCHAR, QMS_HCHAR,
- X QMS_VTIC, QMS_HTIC, options_null, QMS_init,QMS_reset,
- X QMS_text, null_scale, QMS_graphics, QMS_move, QMS_vector,
- X QMS_linetype,QMS_put_text, null_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef REGIS
- X ,{"regis", "REGIS graphics language",
- X REGISXMAX, REGISYMAX, REGISVCHAR, REGISHCHAR,
- X REGISVTIC, REGISHTIC, options_null, REGISinit, REGISreset,
- X REGIStext, null_scale, REGISgraphics, REGISmove, REGISvector,
- X REGISlinetype, REGISput_text, REGIStext_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X
- X#ifdef SELANAR
- X ,{"selanar", "Selanar",
- X TEK40XMAX, TEK40YMAX, TEK40VCHAR, TEK40HCHAR,
- X TEK40VTIC, TEK40HTIC, options_null, SEL_init, SEL_reset,
- X SEL_text, null_scale, SEL_graphics, TEK40move, TEK40vector,
- X TEK40linetype, TEK40put_text, null_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef STARC
- X ,{"starc", "Star Color Printer",
- X STARCXMAX, STARCYMAX, STARCVCHAR, STARCHCHAR,
- X STARCVTIC, STARCHTIC, options_null, STARCinit, STARCreset,
- X STARCtext, null_scale, STARCgraphics, STARCmove, STARCvector,
- X STARClinetype, STARCput_text, STARC_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef SUN
- X ,{"sun", "SunView window system",
- X SUN_XMAX, SUN_YMAX, SUN_VCHAR, SUN_HCHAR,
- X SUN_VTIC, SUN_HTIC, options_null, SUN_init, SUN_reset,
- X SUN_text, null_scale, SUN_graphics, SUN_move, SUN_vector,
- X SUN_linetype, SUN_put_text, null_text_angle,
- X SUN_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef VWS
- X ,{"VWS", "VAX Windowing System (UIS)",
- X VWS_XMAX, VWS_YMAX, VWS_VCHAR, VWS_HCHAR,
- X VWS_VTIC, VWS_HTIC, options_null, VWS_init, VWS_reset,
- X VWS_text, null_scale, VWS_graphics, VWS_move, VWS_vector,
- X VWS_linetype, VWS_put_text, VWS_text_angle,
- X VWS_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef TANDY60
- X ,{"tandy_60dpi", "Tandy DMP-130 series 60-dot per inch graphics",
- X EPS60XMAX, EPS60YMAX, EPSONVCHAR, EPSONHCHAR,
- X EPSONVTIC, EPSONHTIC, options_null, EPSONinit, EPSONreset,
- X TANDY60text, null_scale, EPS60graphics, EPSONmove, EPSONvector,
- X EPSONlinetype, EPSONput_text, EPSON_text_angle,
- X null_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef T410X
- X ,{"tek410x", "Tektronix 4106, 4107, 4109 and 420X terminals",
- X T410XXMAX, T410XYMAX, T410XVCHAR, T410XHCHAR,
- X T410XVTIC, T410XHTIC, options_null, T410X_init, T410X_reset,
- X T410X_text, null_scale, T410X_graphics, T410X_move, T410X_vector,
- X T410X_linetype, T410X_put_text, T410X_text_angle,
- X null_justify_text, T410X_point, do_arrow}
- X#endif
- X
- X#ifdef TEK
- X ,{"tek40xx", "Tektronix 4010 and others; most TEK emulators",
- X TEK40XMAX, TEK40YMAX, TEK40VCHAR, TEK40HCHAR,
- X TEK40VTIC, TEK40HTIC, options_null, TEK40init, TEK40reset,
- X TEK40text, null_scale, TEK40graphics, TEK40move, TEK40vector,
- X TEK40linetype, TEK40put_text, null_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef UNIXPLOT
- X ,{"unixplot", "Unix plotting standard (see plot(1))",
- X UP_XMAX, UP_YMAX, UP_VCHAR, UP_HCHAR,
- X UP_VTIC, UP_HTIC, options_null, UP_init, UP_reset,
- X UP_text, null_scale, UP_graphics, UP_move, UP_vector,
- X UP_linetype, UP_put_text, null_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef UNIXPC
- X ,{"unixpc", "AT&T 3b1 or AT&T 7300 Unix PC",
- X uPC_XMAX, uPC_YMAX, uPC_VCHAR, uPC_HCHAR,
- X uPC_VTIC, uPC_HTIC, options_null, uPC_init, uPC_reset,
- X uPC_text, null_scale, uPC_graphics, uPC_move, uPC_vector,
- X uPC_linetype, uPC_put_text, uPC_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef V384
- X ,{"vx384", "Vectrix 384 and Tandy color printer",
- X V384_XMAX, V384_YMAX, V384_VCHAR, V384_HCHAR,
- X V384_VTIC, V384_HTIC, options_null, V384_init, V384_reset,
- X V384_text, null_scale, V384_graphics, V384_move, V384_vector,
- X V384_linetype, V384_put_text, null_text_angle,
- X null_justify_text, do_point, do_arrow}
- X#endif
- X
- X#ifdef VTTEK
- X ,{"vttek", "VT-like tek40xx terminal emulator",
- X TEK40XMAX,TEK40YMAX,TEK40VCHAR, TEK40HCHAR,
- X TEK40VTIC, TEK40HTIC, options_null, VTTEK40init, VTTEK40reset,
- X TEK40text, null_scale, TEK40graphics, TEK40move, TEK40vector,
- X VTTEK40linetype, VTTEK40put_text, null_text_angle,
- X null_justify_text, line_and_point, do_arrow}
- X#endif
- X
- X#ifdef X11
- X ,{"x11", "X11 Window System",
- X X11_XMAX, X11_YMAX, X11_VCHAR, X11_HCHAR,
- X X11_VTIC, X11_HTIC, options_null, X11_init, X11_reset,
- X X11_text, null_scale, X11_graphics, X11_move, X11_vector,
- X X11_linetype, X11_put_text, null_text_angle,
- X X11_justify_text, line_and_point, do_arrow}
- X ,{"X11", "X11 Window System - multi-color points",
- X X11_XMAX, X11_YMAX, X11_VCHAR, X11_HCHAR,
- X X11_VTIC, X11_HTIC, options_null, X11_init, X11_reset,
- X X11_text, null_scale, X11_graphics, X11_move, X11_vector,
- X X11_linetype, X11_put_text, null_text_angle,
- X X11_justify_text, do_point, do_arrow}
- X#endif
- X};
- X
- X#define TERMCOUNT (sizeof(term_tbl)/sizeof(struct termentry))
- X
- X
- Xgt_list_terms()
- X{
- Xregister int i;
- X
- X fprintf(stderr,"\nAvailable terminal types:\n");
- X for (i = 0; i < TERMCOUNT; i++)
- X fprintf(stderr," %15s %s\n",
- X term_tbl[i].name, term_tbl[i].description);
- X (void) putc('\n',stderr);
- X}
- X
- X
- X#ifdef NOT_USED_IN_GPLOTLIB
- X/* set_term: get terminal number from name on command line */
- X/* will change 'term' variable if successful */
- Xint /* term number */
- Xset_term(c_token)
- Xint c_token;
- X{
- X register int t;
- X char *input_name;
- X
- X if (!token[c_token].is_token)
- X int_error("terminal name expected",c_token);
- X t = -1;
- X input_name = input_line + token[c_token].start_index;
- X t = gt_change_term(input_name, token[c_token].length);
- X if (t == -1)
- X int_error("unknown terminal type; type just 'set terminal' for a list",
- X c_token);
- X if (t == -2)
- X int_error("ambiguous terminal name; type just 'set terminal' for a list",
- X c_token);
- X
- X /* otherwise the type was changed */
- X
- X return(t);
- X}
- X#endif
- X
- Xgt_change_file (fp)
- XFILE *fp;
- X/*-
- X Routine to change the file pointer (stream) being used to write
- X to with gplotlib (GToutfile). This is generally preferred to just
- X replacing GToutfile on the fly as it will flush any output and
- X also handles unixplot files properly. Note that GSRoutfile is
- X really the same as GToutfile, so this routine serves the function
- X of changing the outfile for gsr code also.
- X
- X Parameter:
- X
- X fp: New value to use for GToutfile (pointer from fopen()),
- X if NULL then replace GToutfile with original stdout
- X value.
- X-*/
- X{
- X/*
- X Most of this code is just taken from SET OUTPUT in order to handle
- X the unixplot redirections. Guess it's worth it...
- X*/
- X if (fp == NULL) {
- X UP_redirect (4);
- X if (outfile != stdout) /* Never close stdout */
- X (void) fclose(outfile);
- X outfile = stdout; /* Don't dup... */
- X GTterm_init = FALSE;
- X }
- X else {
- X if (outfile != stdout) /* Never close stdout */
- X (void) fclose(outfile);
- X outfile = fp;
- X GTterm_init = FALSE;
- X UP_redirect (1);
- X }
- X}
- X
- X/* gt_change_term: get terminal number from name and set terminal type */
- X/* returns -1 if unknown, -2 if ambiguous, >=0 is terminal number */
- Xint
- Xgt_change_term(name, length)
- X char *name;
- X int length;
- X{
- X int i, t = -1;
- X
- X for (i = 0; i < TERMCOUNT; i++) {
- X if (!strncmp(name,term_tbl[i].name,length)) {
- X if (t != -1)
- X return(-2); /* ambiguous */
- X t = i;
- X }
- X }
- X
- X if (t == -1) /* unknown */
- X return(t);
- X
- X /* Success: set terminal type now */
- X
- X term = t;
- X term_init = FALSE;
- X name = term_tbl[term].name;
- X
- X /* Special handling for unixplot term type */
- X if (!strncmp("unixplot",name,8)) {
- X UP_redirect (2); /* Redirect actual stdout for unixplots */
- X } else if (unixplot) {
- X UP_redirect (3); /* Put stdout back together again. */
- X }
- X
- X if (interactive)
- X fprintf(stderr, "Terminal type set to '%s'\n", name);
- X
- X return(t);
- X}
- X
- X/*
- X Routine to detect what terminal is being used (or do anything else
- X that would be nice). One anticipated (or allowed for) side effect
- X is that the global ``term'' may be set.
- X The environment variable GNUTERM is checked first; if that does
- X not exist, then the terminal hardware is checked, if possible,
- X and finally, we can check $TERM for some kinds of terminals.
- X*/
- X/* thanks to osupyr!alden (Dave Alden) for the original GNUTERM code */
- Xgt_init_terminal()
- X{
- X char *term_name = NULL;
- X int t;
- X char *term = NULL; /* from TERM environment var */
- X#ifdef X11
- X char *display = NULL;
- X#endif
- X char *gnuterm = NULL;
- X
- X /* GNUTERM environment variable is primary */
- X gnuterm = getenv("GNUTERM");
- X if (gnuterm != (char *)NULL)
- X term_name = gnuterm;
- X else {
- X#ifdef __TURBOC__
- X term_name = turboc_init();
- X term = (char *)NULL; /* shut up turbo C */
- X#endif
- X
- X#ifdef vms
- X term_name = vms_init();
- X#endif
- X
- X#ifdef SUN
- X term = getenv("TERM"); /* try $TERM */
- X if (term_name == (char *)NULL
- X && term != (char *)NULL && strcmp(term, "sun") == 0)
- X term_name = "sun";
- X#endif /* sun */
- X
- X#ifdef GPR
- X if (gpr_isa_pad()) term_name = "gpr"; /* find out whether stdout is a DM pad. See term/gpr.trm */
- X#else
- X#ifdef APOLLO
- X if (apollo_isa_pad()) term_name = "apollo"; /* find out whether stdout is a DM pad. See term/apollo.trm */
- X#endif /* APOLLO */
- X#endif /* GPR */
- X
- X#ifdef X11
- X term = getenv("TERM"); /* try $TERM */
- X if (term_name == (char *)NULL
- X && term != (char *)NULL && strcmp(term, "xterm") == 0)
- X term_name = "x11";
- X display = getenv("DISPLAY");
- X if (term_name == (char *)NULL && display != (char *)NULL)
- X term_name = "x11";
- X#endif /* x11 */
- X
- X#ifdef AMIGASCREEN
- X term_name = "amiga";
- X#endif
- X
- X#ifdef UNIXPC
- X if (iswind() == 0) {
- X term_name = "unixpc";
- X }
- X#endif /* unixpc */
- X
- X#ifdef CGI
- X if (getenv("CGIDISP") || getenv("CGIPRNT"))
- X term_name = "cgi";
- X#endif /*CGI */
- X }
- X
- X /* We have a name, try to set term type */
- X if (term_name != NULL && *term_name != '\0') {
- X t = gt_change_term(term_name, strlen(term_name));
- X if (t == -1)
- X fprintf(stderr, "Unknown terminal name '%s'\n", term_name);
- X else if (t == -2)
- X fprintf(stderr, "Ambiguous terminal name '%s'\n", term_name);
- X else /* successful */
- X ;
- X }
- X}
- X
- X
- X#ifdef __TURBOC__
- Xstatic char *
- Xturboc_init()
- X{
- X int g_driver,g_mode;
- X char far *c1,*c2;
- X char *term_name = NULL;
- X struct text_info tinfo; /* So we can restore starting text mode. */
- X
- X/* Some of this code including BGI drivers is copyright Borland Intl. */
- X g_driver=DETECT;
- X get_path();
- X gettextinfo(&tinfo);
- X initgraph(&g_driver,&g_mode,path);
- X c1=getdrivername();
- X c2=getmodename(g_mode);
- X switch (g_driver){
- X case -2: fprintf(stderr,"Graphics card not detected.\n");
- X break;
- X case -3: fprintf(stderr,"BGI driver file cannot be found.\n");
- X break;
- X case -4: fprintf(stderr,"Invalid BGI driver file.\n");
- X break;
- X case -5: fprintf(stderr,"Insufficient memory to load ",
- X "graphics driver.");
- X break;
- X case 1 : term_name = "cga";
- X break;
- X case 2 : term_name = "mcga";
- X break;
- X case 3 :
- X case 4 : term_name = "egalib";
- X break;
- X case 7 : term_name = "hercules";
- X break;
- X case 8 : term_name = "att";
- X break;
- X case 9 : term_name = "vgalib";
- X break;
- X }
- X closegraph();
- X textmode(tinfo.currmode);
- X clrscr();
- X fprintf(stderr,"\tTC Graphics, driver %s mode %s\n",c1,c2);
- X return(term_name);
- X}
- X#endif /* __TURBOC__ */
- X
- X/*
- X This is always defined so we don't have to have command.c know if it
- X is there or not.
- X*/
- X#ifndef UNIXPLOT
- XUP_redirect(caller) int caller;
- X{
- X caller = caller; /* to stop Turbo C complaining
- X * about caller not being used */
- X}
- X#else
- XUP_redirect (caller)
- Xint caller;
- X/*
- X Unixplot can't really write to outfile--it wants to write to stdout.
- X This is normally ok, but the original design of gnuplot gives us
- X little choice. Originally users of unixplot had to anticipate
- X their needs and redirect all I/O to a file... Not very gnuplot-like.
- X
- X caller: 1 - called from SET OUTPUT "FOO.OUT"
- X 2 - called from SET TERM UNIXPLOT
- X 3 - called from SET TERM other
- X 4 - called from SET OUTPUT
- X*/
- X{
- X switch (caller) {
- X case 1:
- X /* Don't save, just replace stdout w/outfile (save was already done). */
- X if (unixplot)
- X *(stdout) = *(outfile); /* Copy FILE structure */
- X break;
- X case 2:
- X if (!unixplot) {
- X fflush(stdout);
- X save_stdout = *(stdout);
- X *(stdout) = *(outfile); /* Copy FILE structure */
- X unixplot = 1;
- X }
- X break;
- X case 3:
- X /* New terminal in use--put stdout back to original. */
- X closepl();
- X fflush(stdout);
- X *(stdout) = save_stdout; /* Copy FILE structure */
- X unixplot = 0;
- X break;
- X case 4:
- X /* User really wants to go to normal output... */
- X if (unixplot) {
- X fflush(stdout);
- X *(stdout) = save_stdout; /* Copy FILE structure */
- X }
- X break;
- X }
- X}
- X#endif
- X
- X
- X/* test terminal by drawing border and text */
- X/* called from command test */
- Xgt_test_term()
- X{
- X register struct termentry *t = &term_tbl[term];
- X char *str;
- X int x,y, xl,yl, i;
- X unsigned int xmax, ymax;
- X char label[MAX_ID_LEN];
- X int scaling;
- X
- X if (!term_init) {
- X (*t->init)();
- X term_init = TRUE;
- X }
- X screen_ok = FALSE;
- X scaling = (*t->scale)(xsize, ysize);
- X xmax = (unsigned int)(t->xmax * (scaling ? 1 : xsize));
- X ymax = (unsigned int)(t->ymax * (scaling ? 1 : ysize));
- X (*t->graphics)();
- X /* border linetype */
- X (*t->linetype)(-2);
- X (*t->move)(0,0);
- X (*t->vector)(xmax-1,0);
- X (*t->vector)(xmax-1,ymax-1);
- X (*t->vector)(0,ymax-1);
- X (*t->vector)(0,0);
- X (void) (*t->justify_text)(LEFT);
- X (*t->put_text)(t->h_char*5,ymax-t->v_char*3,"Terminal Test");
- X /* axis linetype */
- X (*t->linetype)(-1);
- X (*t->move)(xmax/2,0);
- X (*t->vector)(xmax/2,ymax-1);
- X (*t->move)(0,ymax/2);
- X (*t->vector)(xmax-1,ymax/2);
- X /* test width and height of characters */
- X (*t->linetype)(-2);
- X (*t->move)( xmax/2-t->h_char*10,ymax/2+t->v_char/2);
- X (*t->vector)(xmax/2+t->h_char*10,ymax/2+t->v_char/2);
- X (*t->vector)(xmax/2+t->h_char*10,ymax/2-t->v_char/2);
- X (*t->vector)(xmax/2-t->h_char*10,ymax/2-t->v_char/2);
- X (*t->vector)(xmax/2-t->h_char*10,ymax/2+t->v_char/2);
- X (*t->put_text)(xmax/2-t->h_char*10,ymax/2,
- X "12345678901234567890");
- X /* test justification */
- X (void) (*t->justify_text)(LEFT);
- X (*t->put_text)(xmax/2,ymax/2+t->v_char*6,"left justified");
- X str = "centre+d text";
- X if ((*t->justify_text)(CENTRE))
- X (*t->put_text)(xmax/2,
- X ymax/2+t->v_char*5,str);
- X else
- X (*t->put_text)(xmax/2-strlen(str)*t->h_char/2,
- X ymax/2+t->v_char*5,str);
- X str = "right justified";
- X if ((*t->justify_text)(RIGHT))
- X (*t->put_text)(xmax/2,
- X ymax/2+t->v_char*4,str);
- X else
- X (*t->put_text)(xmax/2-strlen(str)*t->h_char,
- X ymax/2+t->v_char*4,str);
- X /* test text angle */
- X str = "rotated ce+ntred text";
- X if ((*t->text_angle)(1)) {
- X if ((*t->justify_text)(CENTRE))
- X (*t->put_text)(t->v_char,
- X ymax/2,str);
- X else
- X (*t->put_text)(t->v_char,
- X ymax/2-strlen(str)*t->h_char/2,str);
- X }
- X else {
- X (void) (*t->justify_text)(LEFT);
- X (*t->put_text)(t->h_char*2,ymax/2-t->v_char*2,"Can't rotate text");
- X }
- X (void) (*t->justify_text)(LEFT);
- X (void) (*t->text_angle)(0);
- X /* test tic size */
- X (*t->move)(xmax/2+t->h_tic*2,0);
- X (*t->vector)(xmax/2+t->h_tic*2,t->v_tic);
- X (*t->move)(xmax/2,t->v_tic*2);
- X (*t->vector)(xmax/2+t->h_tic,t->v_tic*2);
- X (*t->put_text)(xmax/2+t->h_tic*2,t->v_tic*2+t->v_char/2,"test tics");
- X /* test line and point types */
- X x = xmax - t->h_char*4 - t->h_tic*4;
- X y = ymax - t->v_char;
- X for ( i = -2; y > t->v_char; i++ ) {
- X (*t->linetype)(i);
- X (void) sprintf(label,"%d",i);
- X if ((*t->justify_text)(RIGHT))
- X (*t->put_text)(x,y,label);
- X else
- X (*t->put_text)(x-strlen(label)*t->h_char,y,label);
- X (*t->move)(x+t->h_char,y);
- X (*t->vector)(x+t->h_char*4,y);
- X if ( i >= -1 )
- X (*t->point)(x+t->h_char*4+t->h_tic*2,y,i);
- X y -= t->v_char;
- X }
- X /* test some arrows */
- X (*t->linetype)(0);
- X x = xmax/4;
- X y = ymax/4;
- X xl = t->h_tic*5;
- X yl = t->v_tic*5;
- X (*t->arrow)(x,y,x+xl,y,TRUE);
- X (*t->arrow)(x,y,x+xl/2,y+yl,TRUE);
- X (*t->arrow)(x,y,x,y+yl,TRUE);
- X (*t->arrow)(x,y,x-xl/2,y+yl,FALSE);
- X (*t->arrow)(x,y,x-xl,y,TRUE);
- X (*t->arrow)(x,y,x-xl,y-yl,TRUE);
- X (*t->arrow)(x,y,x,y-yl,TRUE);
- X (*t->arrow)(x,y,x+xl,y-yl,TRUE);
- X /* and back into text mode */
- X (*t->text)();
- X}
- X
- X
- X#ifdef PC
- X/* output for some terminal types must be binary to stop non Unix computers
- X changing \n to \r\n.
- X If the output is not STDOUT, the following code reopens outfile
- X with binary mode. */
- Xvoid
- Xreopen_binary()
- X{
- Xchar filename[MAX_ID_LEN+1];
- X
- X if (strcmp(outstr,"STDOUT")) {
- X (void) fclose(outfile);
- X (void) strcpy(filename,outstr+1); /* remove quotes */
- X filename[strlen(filename)-1] = '\0';
- X if ( (outfile = fopen(filename,"wb")) == (FILE *)NULL ) {
- X if ( (outfile = fopen(filename,"w")) == (FILE *)NULL ) {
- X os_error("cannot reopen file with binary type; output unknown",
- X NO_CARET);
- X }
- X else {
- X os_error("cannot reopen file with binary type; output reset to ascii",
- X NO_CARET);
- X }
- X }
- X }
- X}
- X#endif
- X
- X#ifdef vms
- X/* these are needed to modify terminal characteristics */
- X#include <descrip.h>
- X#include <iodef.h>
- X#include <ttdef.h>
- X#include <tt2def.h>
- X#include <dcdef.h>
- X#include <ssdef.h>
- X#include <stat.h>
- X#include <fab.h>
- Xstatic unsigned short chan;
- Xstatic int old_char_buf[3], cur_char_buf[3];
- X$DESCRIPTOR(sysoutput_desc,"SYS$OUTPUT");
- X
- Xstatic char *vms_init()
- X/*
- X * Determine if we have a regis terminal
- X * and save terminal characteristics
- X*/
- X{
- X /* Save terminal characteristics in old_char_buf and
- X initialise cur_char_buf to current settings. */
- X int i;
- X sys$assign(&sysoutput_desc,&chan,0,0);
- X sys$qiow(0,chan,IO$_SENSEMODE,0,0,0,old_char_buf,12,0,0,0,0);
- X for (i = 0 ; i < 3 ; ++i) cur_char_buf[i] = old_char_buf[i];
- X sys$dassgn(chan);
- X
- X /* Test if terminal is regis */
- X if ((cur_char_buf[2] & TT2$M_REGIS) == TT2$M_REGIS) return("regis");
- X return(NULL);
- X}
- X
- Xstatic void
- Xvms_reset()
- X/* set terminal to original state */
- X{
- X int i;
- X sys$assign(&sysoutput_desc,&chan,0,0);
- X sys$qiow(0,chan,IO$_SETMODE,0,0,0,old_char_buf,12,0,0,0,0);
- X for (i = 0 ; i < 3 ; ++i) cur_char_buf[i] = old_char_buf[i];
- X sys$dassgn(chan);
- X}
- X
- Xstatic void
- Xterm_mode_tek()
- X/* set terminal mode to tektronix */
- X{
- X long status;
- X if (outfile != stdout) return; /* don't modify if not stdout */
- X sys$assign(&sysoutput_desc,&chan,0,0);
- X cur_char_buf[0] = 0x004A0000 | DC$_TERM | (TT$_TEK401X<<8);
- X cur_char_buf[1] = (cur_char_buf[1] & 0x00FFFFFF) | 0x18000000;
- X
- X cur_char_buf[1] &= ~TT$M_CRFILL;
- X cur_char_buf[1] &= ~TT$M_ESCAPE;
- X cur_char_buf[1] &= ~TT$M_HALFDUP;
- X cur_char_buf[1] &= ~TT$M_LFFILL;
- X cur_char_buf[1] &= ~TT$M_MECHFORM;
- X cur_char_buf[1] &= ~TT$M_NOBRDCST;
- X cur_char_buf[1] &= ~TT$M_NOECHO;
- X cur_char_buf[1] &= ~TT$M_READSYNC;
- X cur_char_buf[1] &= ~TT$M_REMOTE;
- X cur_char_buf[1] |= TT$M_LOWER;
- X cur_char_buf[1] |= TT$M_TTSYNC;
- X cur_char_buf[1] |= TT$M_WRAP;
- X cur_char_buf[1] &= ~TT$M_EIGHTBIT;
- X cur_char_buf[1] &= ~TT$M_MECHTAB;
- X cur_char_buf[1] &= ~TT$M_SCOPE;
- X cur_char_buf[1] |= TT$M_HOSTSYNC;
- X
- X cur_char_buf[2] &= ~TT2$M_APP_KEYPAD;
- X cur_char_buf[2] &= ~TT2$M_BLOCK;
- X cur_char_buf[2] &= ~TT2$M_DECCRT3;
- X cur_char_buf[2] &= ~TT2$M_LOCALECHO;
- X cur_char_buf[2] &= ~TT2$M_PASTHRU;
- X cur_char_buf[2] &= ~TT2$M_REGIS;
- X cur_char_buf[2] &= ~TT2$M_SIXEL;
- X cur_char_buf[2] |= TT2$M_BRDCSTMBX;
- X cur_char_buf[2] |= TT2$M_EDITING;
- X cur_char_buf[2] |= TT2$M_INSERT;
- X cur_char_buf[2] |= TT2$M_PRINTER;
- X cur_char_buf[2] &= ~TT2$M_ANSICRT;
- X cur_char_buf[2] &= ~TT2$M_AVO;
- X cur_char_buf[2] &= ~TT2$M_DECCRT;
- X cur_char_buf[2] &= ~TT2$M_DECCRT2;
- X cur_char_buf[2] &= ~TT2$M_DRCS;
- X cur_char_buf[2] &= ~TT2$M_EDIT;
- X cur_char_buf[2] |= TT2$M_FALLBACK;
- X
- X status = sys$qiow(0,chan,IO$_SETMODE,0,0,0,cur_char_buf,12,0,0,0,0);
- X if (status == SS$_BADPARAM) {
- X /* terminal fallback utility not installed on system */
- X cur_char_buf[2] &= ~TT2$M_FALLBACK;
- X sys$qiow(0,chan,IO$_SETMODE,0,0,0,cur_char_buf,12,0,0,0,0);
- X }
- X else {
- X if (status != SS$_NORMAL)
- X lib$signal(status,0,0);
- X }
- X sys$dassgn(chan);
- X}
- X
- Xstatic void
- Xterm_mode_native()
- X/* set terminal mode back to native */
- X{
- X int i;
- X if (outfile != stdout) return; /* don't modify if not stdout */
- X sys$assign(&sysoutput_desc,&chan,0,0);
- X sys$qiow(0,chan,IO$_SETMODE,0,0,0,old_char_buf,12,0,0,0,0);
- X for (i = 0 ; i < 3 ; ++i) cur_char_buf[i] = old_char_buf[i];
- X sys$dassgn(chan);
- X}
- X
- Xstatic void
- Xterm_pasthru()
- X/* set terminal mode pasthru */
- X{
- X if (outfile != stdout) return; /* don't modify if not stdout */
- X sys$assign(&sysoutput_desc,&chan,0,0);
- X cur_char_buf[2] |= TT2$M_PASTHRU;
- X sys$qiow(0,chan,IO$_SETMODE,0,0,0,cur_char_buf,12,0,0,0,0);
- X sys$dassgn(chan);
- X}
- X
- Xstatic void
- Xterm_nopasthru()
- X/* set terminal mode nopasthru */
- X{
- X if (outfile != stdout) return; /* don't modify if not stdout */
- X sys$assign(&sysoutput_desc,&chan,0,0);
- X cur_char_buf[2] &= ~TT2$M_PASTHRU;
- X sys$qiow(0,chan,IO$_SETMODE,0,0,0,cur_char_buf,12,0,0,0,0);
- X sys$dassgn(chan);
- X}
- X
- Xstatic void
- Xreopen_binary()
- X/* close the file outfile outfile and reopen it with binary type
- X if not already done or outfile == stdout */
- X{
- X stat_t stat_buf;
- X char filename[MAX_ID_LEN+1];
- X if (outfile != stdout) { /* don't modify if not stdout */
- X if (!fstat(fileno(outfile),&stat_buf)) {
- X if (stat_buf.st_fab_rfm != FAB$C_FIX) {
- X /* modify only if not already done */
- X (void) fclose(outfile);
- X (void) strcpy(filename,outstr+1); /* remove quotes */
- X filename[strlen(filename)-1] = '\0';
- X (void) delete(filename);
- X if ((outfile = fopen(filename,"wb","rfm=fix","bls=512","mrs=512"))
- X == (FILE *)NULL ) {
- X if ( (outfile = fopen(filename,"w")) == (FILE *)NULL ) {
- X os_error("cannot reopen file with binary type; output unknown",
- X NO_CARET);
- X }
- X else {
- X os_error("cannot reopen file with binary type; output reset to ascii",
- X NO_CARET);
- X }
- X }
- X }
- X }
- X else{
- X os_error("cannot reopen file with binary type; output remains ascii",
- X NO_CARET);
- X }
- X }
- X}
- X
- Xstatic void
- Xfflush_binary()
- X{
- X typedef short int INT16; /* signed 16-bit integers */
- X register INT16 k; /* loop index */
- X if (outfile != stdout) {
- X /* Stupid VMS fflush() raises error and loses last data block
- X unless it is full for a fixed-length record binary file.
- X Pad it here with NULL characters. */
- X for (k = (INT16)((*outfile)->_cnt); k > 0; --k)
- X putc('\0',outfile);
- X fflush(outfile);
- X }
- X}
- X#endif
- END_OF_FILE
- if test 53371 -ne `wc -c <'gterm.c'`; then
- echo shar: \"'gterm.c'\" unpacked with wrong size!
- fi
- # end of 'gterm.c'
- fi
- echo shar: End of archive 5 \(of 5\).
- cp /dev/null ark5isdone
- MISSING=""
- for I in 1 2 3 4 5 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 5 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
-